#include<stdio.h>
#include"utils.h"
#include<string.h>
int Hex2Char(int fromi,char *toc)
{
    if(fromi>=0&&fromi<=9)
    {
     *toc= fromi+'0';
    } 
    else if(fromi>=10&&fromi<=15)
    {
     *toc = fromi+'A'-10;
    }
    else
    {
        printf("不在范围内!");
    }
    return 0;
}
int Char2Hex(char fromc,int *toi)
{
 if(fromc>='0'&& fromc<='9')
 {
             *toi= fromc-'0';
 }
 else if(fromc>='A'&& fromc<='F')
 {
             *toi= fromc-'A'+10;
 
        }
        else{
             printf("不在范围内");
        }
 return 0;
}